home *** CD-ROM | disk | FTP | other *** search
- /* $VER: bbsMan.rexx 8.3 (21.12.94)
- Copyright © 1994 Richard Lee Stockton
- Offline (LOCAL) BBBBS Manager
- FREELY DISTRIBUTABLE
- */
-
- reader='C:mo' /* path to YOUR text reader here. I use ppmore */
-
- IF ~SHOW('P','QuickSortPort') THEN CALL setup.rexx()
- IF ~SHOW('P','QuickSortPort') THEN EXIT 666
-
- title.=''
- title.1='BBBBS Manager'
- title.2='Version 8.3'
- title.3='21-Dec-94'
-
- def=''
- pen3=''
- lineup='1B'x'M'
-
- figarg='s:CONFIG.BBS'
- IF ~EXISTS(figarg) THEN figarg='BBS:BBS_TEXT/CONFIG.BBS'
- x=OPEN(f,figarg,'R')
- IF x=0 THEN
- DO
- SAY 's:CONFIG.BBS and BBS:BBS/CONFIG.BBS are both missing!'
- EXIT
- END
- lynes.=''
- DO i=1 TO 40
- lynes.i=READLN(f)
- END
- CALL CLOSE(f)
-
- compos=POS('/*',lynes.1)
- IF compos>0 THEN lynes.1=LEFT(lynes.1,compos-1)
- bbsname=STRIP(lynes.1)
- sysop=WORD(lynes.2,1)
- compos=POS('/*',lynes.3)
- IF compos>0 THEN lynes.3=LEFT(lynes.3,compos-1)
- bbsdevice=WORD(lynes.4,1)
- sysoplevel=WORD(lynes.5,1)
- bbspath=WORD(lynes.6,1)
- IF ~EXISTS(bbspath) THEN
- DO
- SAY bbspath 'does not exist!'
- EXIT
- END
- testchar=RIGHT(bbspath,1)
- IF testchar~='/' & testchar~=':' THEN bbspath=bbspath'/'
- extdevs=''
- DO i=1 TO WORDS(lynes.10)
- test=WORD(lynes.10,i)
- IF POS(':',test)=0 THEN ITERATE i
- IF LEFT(test,2)='/*' THEN LEAVE i
- extdevs=STRIP(extdevs test)
- END
- IF WORD(lynes.25,1)=1 THEN scratch=bbspath'Scratch'
- ELSE scratch='RAM:Scratch'
-
- OPTIONS PROMPT ' Are you 'sysop'? (Yn) > '
- PULL answer
- IF answer='N' THEN
- DO
- SAY
- OPTIONS PROMPT ' Please enter your name > '
- PULL name
- name=cleanstring('1:'name)
- IF name='' THEN EXIT
- IF ~EXISTS(bbspath'Users/'name) THEN
- DO
- SAY name 'does not exist!'
- EXIT
- END
- END
- ELSE name=sysop
- userfile=bbspath'Users/'name
- CALL OPEN(f,userfile,'R')
- data.=''
- DO i=1
- line=READLN(f)
- IF EOF(f) THEN LEAVE i
- data.i=line
- END
- CALL CLOSE(f)
- data.0=i-1
- password=data.5
- linesperpage=20
- colorflag=1
- level=data.20
-
- passprompt=pen3' Please Enter Password: '
- DO tries=1 TO 3
- OPTIONS PROMPT passprompt
- PULL newpassword
- SAY def
- IF(password=newpassword) THEN LEAVE tries; /* correct password */
- IF tries=3 THEN
- DO
- SAY
- SAY 'Access terminated.'
- SAY '*** Bad password ***' newpassword '***'
- EXIT
- END
- passprompt='Incorrect. Password: ' /* ask again */
- END
- SAY
- SAY' OK, 'name' here we go....'
- SAY
-
- OPTIONS PROMPT pen3'Select: 'def
- DO FOREVER
- CALL header(26)
- DO i=1 TO 3
- SAY CENTER(title.i,26)
- END
- SAY
- SAY ' 1. Doors'
- SAY ' 2. Files'
- SAY ' 3. Info'
- SAY ' 4. Mail'
- SAY ' 5. Messages'
- SAY ' 6. Users'
- SAY ' Q. Quit'
- PULL temp
- temp=LEFT(temp,1)
- IF temp=1 THEN CALL bbsDoors(3000 name password)
- ELSE IF temp=2 THEN
- DO subloop=1
- CALL header(34)
- SAY ' 1. File Manager (Add-Edit-Browse)'
- SAY ' 2. Start File Usage Report'
- SAY ' 3. External Devices'
- PULL temp
- IF temp=1 THEN CALL bbsFile(name password)
- ELSE IF temp=2 THEN
- DO
- SAY
- SAY 'Enter -1 (or blank) for no least-downloaded-files report, or'
- OPTIONS PROMPT 'enter smallest least-downloaded filesize to report > '
- PULL filesize
- IF ~DATATYPE(filesize,'W') THEN filesize=-1
- IF filesize<-1 THEN filesize=-1
- SAY
- IF filesize>=0 THEN
- SAY 'Includes least-used files larger than' filesize 'bytes.'
- SAY 'The FILELISTS_REPORT will be left in email for you.'
- SAY
- ADDRESS AREXX bbsREPORT.rexx name 'FILES' filesize
- OPTIONS PROMPT pen3'Select: 'def
- LEAVE subloop
- END
- ELSE IF temp=3 THEN
- DO
- dl=bbsExtDL.baud(name level 3000 linesperpage colorflag extdevs)
- IF dl='' THEN BREAK
- topath=GETCLIP('BBS_topath')
- IF topath='' THEN topath=GETCLIP('BBS_frompath')
- todir=GetFile(150,36,topath,'',' Select Directory ',,'NOFILES')
- IF RIGHT(todir,1)='/' THEN todir=LEFT(todir,LENGTH(todir)-1)
- IF WORD(STATEF(todir),1)='DIR' THEN
- DO
- IF todir~=topath THEN CALL SETCLIP('BBS_topath')
- DO i=1 TO WORDS(dl)
- mf=WORD(dl,i)
- SAY 'Copying' mf'...'
- ADDRESS COMMAND 'COPY' mf todir 'CLONE'
- END
- END
- ELSE SAY pen3'*'def||todir||pen3'* is not a valid directory!'def
- END
- ELSE IF temp='Q' | temp='' THEN leave subloop
- END
- ELSE IF temp=3 THEN
- DO subloop=1
- CALL header(32)
- SAY ' 1. Daily log'
- SAY ' 2. Numbers log'
- SAY ' 3. QUICK log'
- SAY ' 4. USER log'
- SAY ' 5. Information'
- SAY ' 6. Scratch:'
- SAY ' 7. RAM:'
- t=''
- PULL temp
- IF temp='' | temp='Q' THEN LEAVE subloop
- ELSE IF temp=1 THEN
- DO
- OPTIONS PROMPT '['pen3'RETURN'def']=TODAY, or enter Log Date ('pen3||DATE('S')||def') > '
- PULL t
- OPTIONS PROMPT pen3'Select: 'def
- IF t='' THEN t=DATE('S')
- t=bbspath'Logs/log.'t
- END
- ELSE IF temp=2 THEN t=bbspath'Logs/Numbers.log'
- ELSE IF temp=3 THEN t=bbspath'Logs/QUICK.log'
- ELSE IF temp=4 THEN t=bbspath'Usage/USER.LOG'
- ELSE IF temp=5 THEN t=bbspath'Information/'
- ELSE IF temp=6 THEN t=scratch'/'
- ELSE IF temp=7 THEN t='RAM:'
- IF t~='' THEN ADDRESS COMMAND reader t
- END
- ELSE IF temp=4 THEN
- DO
- CALL SETCLIP('BBSMAIL_ARG','1')
- CALL bbsMail(3000 name password)
- CALL SETCLIP('LOCAL_email')
- END
- ELSE IF temp=5 THEN CALL bbsMsg.rexx(3000 name password)
- ELSE IF temp=6 THEN
- DO subloop=1
- CALL header(34)
- SAY ' 1. User Info'
- SAY ' 2. User Profiles'
- IF level>sysoplevel THEN
- DO
- SAY ' 3. New Users'
- SAY ' 4. Change UserName'
- SAY ' 5. Start Inactive Users Report'
- SAY ' 6. Kill A User'
- END
- PULL temp
- IF temp=1 THEN
- CALL bbsOther.rexx(3000 name sysoplevel 1 bbspath bbsname)
- ELSE IF temp=2 THEN CALL bbsProfiles.rexx(name level sysoplevel 20 1 6000 bbspath)
- ELSE IF temp=3 & level>sysoplevel THEN CALL bbsNewUsers.rexx(name level 1 3000)
- ELSE IF temp=4 & level>sysoplevel THEN
- DO
- SAY
- OPTIONS PROMPT 'Enter Current UserName > '
- PULL oldname
- IF oldname~='' THEN
- DO
- oldname=TRANSLATE(STRIP(oldname),'_',' ')
- IF EXISTS(bbspath'/Users/'name) THEN CALL ChangeUserName(oldname)
- ELSE SAY oldname 'does not have a userfile!'
- END
- OPTIONS PROMPT pen3'Select: 'def
- END
- ELSE IF temp=5 & level>sysoplevel THEN
- DO
- ADDRESS AREXX bbsREPORT.rexx name 'USERS'
- SAY
- SAY 'INACTIVE_USERS report will be left in email for you.'
- SAY
- LEAVE subloop
- END
- ELSE IF temp=6 & level>sysoplevel THEN CALL bbsKillUser()
- ELSE IF temp='Q' | temp='' THEN leave subloop
- END
- ELSE IF temp='Q' THEN EXIT
- END
- EXIT
-
- cleanstring:
- PARSE ARG nflag':'cstr
- namemask=COMPRESS(XRANGE(),XRANGE('A','Z')' _-')
- IF nflag=1 THEN
- DO
- cstr=COMPRESS(cstr,"'`")
- cstr=TRANSLATE(cstr,,namemask)
- cstr=SPACE(cstr,1,'_')
- RETURN cstr
- END
- bot=XRANGE(,'1F'x)
- top=XRANGE('7F'x)
- cstr=COMPRESS(cstr,bot||top)
- IF nflag=0 THEN cstr=STRIP(cstr)
- RETURN cstr
-
-
- header:
- ARG hnum
- SAY
- SAY def
- SAY CENTER(STORAGE() 'bytes free.',hnum)
- SAY pen3||CENTER(name,hnum-1)||def
- RETURN
-
- /* bbsMan.rexx */
-